<?php
class contentLib
{
	/**
	 * @var commonMod
	 */
	private $contentMod;
	
	function __construct()
	{
		$this->contentMod=new commonMod('content');	
	}
	
	public function addContent($title,$content,$time=FALSE,$published=1,$userId=0)
	{
		$title=replaceHtml($title);
		if(empty($title) || empty($content))
		{
			return false;
		}
		$data['title']=$title;
		$data['content']=$content;
		$data['userId']=$userId;
		$data['publishTime']=$time? $time :time();
		$data['published']=$published;
		return $this->contentMod->insertData($data);
	}
}